/*
 * Copyright (c) 2016 UBG - 版权所有
 * 
 * This software is the confidential and proprietary information of
 * UBG. You shall not disclose such confidential information 
 * and shall use it only in accordance with the terms of the license 
 * agreement you entered into with www.7qjf.com.
 */
package bigdata.propertiesobj;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 *
 * 描述: properties工具类
 *
 * @created 2016年12月1日 下午7:29:09
 * @since   v1.0.0
 */
public class BaseProperties {

    public static String path = "";

    public BaseProperties(){}

    public static Properties getProperties() {
        return PropertiesUtils.init(path);
    }
    public static String getValue(String key) {
        Object obj = getProperties().get(key);
        return obj == null?"":obj.toString();
    }

    public static Map<String,String> getMap() {
        Map<String,String> map = new HashMap<String,String>();
        Enumeration<Object> keys = getProperties().keys();
        while(keys.hasMoreElements()){
            Object key = keys.nextElement();
            Object value = getProperties().get(key);
            String valueStr = value == null?"":value.toString();
            map.put(key.toString(),valueStr);
        }
        return map;
    }
	
}
